<!DOCTYPE html>
<html class="no-js" lang="zh">
  <head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="alternate" href="https://www.desgard.com" hreflang="pt-BR">
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="theme-color" content="#005344">
<title>Guardia · 瓜地</title>
<meta name="google-site-verification" content="zS1dSn20XtA4FJYEOQLXqI0boxZdMnJ2g3beje-cl20">
<meta name="description" content="I write many code to write less code.💻 - Página 5 ">
<meta name="keywords" content="">
<!-- Social: Facebook / Open Graph -->
<meta property="og:url" content="https://www.desgard.com/page/5/">
<meta property="og:title" content="Gua | 瓜地   - Page 5">
<meta property="og:description" content="I write many code to write less code.💻 - Página 5 ">
<meta property="og:site_name" content="Desgard_Duan">
<meta property="og:locale" content="pt_BR">
<meta property="og:type" content="website">
<meta property="og:author" content="https://www.facebook.com/desgard.duan">
<meta property="og:image" content="https://www.desgard.com">
<!-- Social: Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@nandomoreirame">
<meta name="twitter:domain" content="https://www.desgard.com">
<meta name="twitter:title" content="Gua | 瓜地   - Page 5">
<meta name="twitter:description" content="I write many code to write less code.💻 - Página 5 ">
<meta name="twitter:image:src" content="https://www.desgard.com">
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="114x114" href="https://www.desgard.com/assets/ico/apple-touch-icon-114-516f4e19976b9e4dbb77ad9b576831fe.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://www.desgard.com/assets/ico/apple-touch-icon-72-5409b2df229305703caf583d86c845ab.png">
<link rel="apple-touch-icon" href="https://www.desgard.com/assets/ico/apple-touch-icon-57-aa873e019cf659e0d4e6a0b5bb9f379d.png">
<link rel="shortcut icon" href="https://www.desgard.com/assets/ico/favicon-4298be3d3fbe23e18d65bded9d930899.png">
<!-- rel prev and next -->
  <link rel="prev" href="https://www.desgard.com/page/4">
  <link rel="next" href="https://www.desgard.com/page/6">
<!-- Canonical link tag -->
<link rel="canonical" href="https://www.desgard.com/page/5/">
<link rel="alternate" type="application/rss+xml" title="Gua" href="https://www.desgard.com/feed.xml">
<link rel="stylesheet" href="/assets/main-0b7b828712f4c43b75bba4861c907bb1.css">
<script src="/assets/modernizr-custom-cb807611a3e262b2eac59444cbab74d6.js" data-cfasync="false"></script>
<script src="/assets/js/jquery-3.1.js"></script>
<script src="/assets/js/jquery.rotate.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Website",
  "publisher": "www.desgard.com",
  "url": "http://www.desgard.com/",
  "description": "瓜地"
}
</script>
<script type="text/javascript">
  var disqus_shortname = 'desgard',
      baseurl          = '';
</script>
<!--
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-52446115-1']);
_gaq.push(['_trackPageview']);
(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>-->
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?c5a8123bc51782a3083a631ed9ff50e4";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [ ['$','$'] ],
        displayMath: [ ['$$','$$'] ],
        processEscapes: true
      }
    });
  </script>
  </head>
  <body class="page-template home">
    <header class="header alt">
  <div class="container">
    <h1><a href="/"><strong>desgard</strong>.com</a></h1>
    <nav class="navbar">
      <ul>
        <li><a href="/">Home</a></li>
        <li><a href="#!" data-modal="modalSearch"><i class="fa fa-search"></i></a></li>
        <li><a href="/comment " target="_blank"><i class="fa fa-comments"></i></a></li>
        <li><a href="/feed.xml" target="_blank"><i class="fa fa-feed"></i></a></li>
      </ul>
    </nav>
  </div>
</header>
      <section class="banner">
  <img src="/assets/images/logo-new.png" alt="author thumb" class="dot animated hinge fadeInDown" id="avartor" width="120px">
  <h2 class="animated hinge fadeInDown" itemscope itemtype="http://schema.org/Person"><strong itemprop="name">Gua</strong><em itemprop="jobTitle">iOS Dev</em> and try everything!</h2>
  <nav class="actions">
    <a href="/about" class="button ghost">About</a>
    <a href="http://project.desgard.com" class="button ghost">Project</a>
  </nav>
</section>
<script>
    $("#avartor").mouseover();
</script>
    <main class="wrapper container" itemprop="mainContentOfPage" itemscope="itemscope" itemtype="http://schema.org/Blog">
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/objc_msgSend1/" title="Permalink to objc_msgSend消息传递学习笔记 - 对象方法消息传递流程">objc_msgSend消息传递学习笔记 - 对象方法消息传递流程</a></h1>
  </header>
  <p><a href="/objc_msgSend1/" title="Permalink to objc_msgSend消息传递学习笔记 - 对象方法消息传递流程" class="read-more">在Effective Objective-C 2.0 - 52 Specific Ways to Improve Your iOS and OS X Programs一书中，tip...</a></p>
  <footer class="post-meta">
    <time datetime="2016-08-06">
      <i class="fa fa-calendar-o"></i> 2016-08-06
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/objc_msgSend1/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/Associated-Objects/" title="Permalink to 浅谈Associated Objects">浅谈Associated Objects</a></h1>
  </header>
  <p><a href="/Associated-Objects/" title="Permalink to 浅谈Associated Objects" class="read-more">俗话说：“金无足赤，人无完人。”对于每一个Class也是这样，尽管我们说这个Class的代码规范、逻辑清晰合理等等，但是总会有它的短板，或者随着需求演进而无法订制实现功能。于是在Objective-C 2.0中引入了category这个特性，用以动态地为已有类添加新行为。面向对象的设计用来描述事物的组成往往是使用Class中的属性成员，这也就局限了方法的广度（在官方文档称之为An otherwise notable shortcoming for Objective-C，译为：Objc的一个显著缺陷）。所以在Runtime中引入了Associated Objects来弥补这一缺陷。 另外，请带着以下疑问来阅读此文： Associated Objects 使用场景。 Associated Objects 五种objc_AssociationPolicy有什么区别。...</a></p>
  <footer class="post-meta">
    <time datetime="2016-07-30">
      <i class="fa fa-calendar-o"></i> 2016-07-30
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/Associated-Objects/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/DGDownloaderButton-2/" title="Permalink to Drip Into A River · Part II">Drip Into A River · Part II</a></h1>
  </header>
  <p><a href="/DGDownloaderButton-2/" title="Permalink to Drip Into A River · Part II" class="read-more">这篇是关于水滴汇集特效的系列二，如果没有看过系列一，可以点击这里查看。 “振动波”效果 分解一下震动效果的全过程。 稍加注意，整个动画需要由4各部分组成： 效果一：整体视图先变小； 效果二：瞬间变大，然后变小并带有弹簧效果； 效果三：在效果二的同时，复制视图，将复制的视图逐渐变大，并修改其alpha值; 效果四：在效果二、效果三的同时，提示用户处于已完成的状态 在排除效果四的情况下，其余效果我们都可以通过UIView Animation来实现。我先给出代码。 #pragma mark - 结束动画 -...</a></p>
  <footer class="post-meta">
    <time datetime="2016-06-29">
      <i class="fa fa-calendar-o"></i> 2016-06-29
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/DGDownloaderButton-2/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/DGDownloaderButton/" title="Permalink to Drip Into A River · Part I">Drip Into A River · Part I</a></h1>
  </header>
  <p><a href="/DGDownloaderButton/" title="Permalink to Drip Into A River · Part I" class="read-more">Sweet iOS Animation Plan 给自己制定了一个很长远的动效学习计划，Sweet-iOS-Animation。其实就是促进喜欢写动效的同学，多多实现dribbble上的优秀作品。我也会定期更新原型图作品表单，收集优秀的原型图。如果大家对此学习计划也有兴趣，可以从这里查看内容。 以上是对于学习计划的简介，下面开始这次动效分析。 “水滴汇集”下载按钮概念图 在dribbble上发现一个创意很好的下载按钮的创意，首先要感谢原型图作者SamuraiChen分享原型图Animation on a concept draft downloads。我将这个特效起名为Drip Into a...</a></p>
  <footer class="post-meta">
    <time datetime="2016-06-28">
      <i class="fa fa-calendar-o"></i> 2016-06-28
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/DGDownloaderButton/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/Reference-Count-Analysis/" title="Permalink to Reference Counting Brief Analysis">Reference Counting Brief Analysis</a></h1>
  </header>
  <p><a href="/Reference-Count-Analysis/" title="Permalink to Reference Counting Brief Analysis" class="read-more">Begin 这篇文不像动画那么有趣。记录的是我在学习Reference Counting中遇到的坑。倘若你之前只是听说过但是没有具体的实践过，我想你在阅读本文后会有很大的收获。 Manual Reference Counting Introduce 笔者学习iOS开发一年有余，对于我的iOS入门书籍，是Objective-C Programming: The Big Nerd Ranch Guide，在23.4部分，对Referrence Counting会有介绍。我们对MRC最初的认识就是，retain计数加一，release计数减一，autorelease计数将来会减一，retainCount可以返回引用计数。当引用计数减到0时，系统将会自动调用对象的dealloc方法，你可以把它类比成C#中的dispose方法，而原先的开发人员可以在dealloc中释放或清理资源。...</a></p>
  <footer class="post-meta">
    <time datetime="2016-06-22">
      <i class="fa fa-calendar-o"></i> 2016-06-22
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/Reference-Count-Analysis/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<article class="post" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
  <header class="post-header">
    <h1 class="post-title"><a href="/The-Card-Interface-For-Signing-Up/" title="Permalink to The Card Interface For Signing Up">The Card Interface For Signing Up</a></h1>
  </header>
  <p><a href="/The-Card-Interface-For-Signing-Up/" title="Permalink to The Card Interface For Signing Up" class="read-more">Apple公司在WWDC 2016前后带来了10个重大更新，其中重中之重可谓是iOS 10的更新了。iOS 10被称作iOS 7之后迎来的最大升级，在所有的革新中，无论在通知中心的UI修改，还是各处的3D Touch弹出层，都能看到卡片式设计的影子。笔者不是设计师，但是以一个iOS开发者的角度来看，iOS的扁平化设计风格，逐渐正在往在Google I/O 2014提出的卡片式设计靠拢。（关于更多的卡片式设计资料可查看这里）。 处此大势之下，我也跟风来搞一波。首先先感谢原型图的作者Sarah，虽然我不是Dribbble的Pro用户，无法在您的作品上留言，但之后我会及时的联系你。以下就是原型图的效果了： 动画分析 观察全部特效，我们发现了以下步骤 弹出卡片弹出窗口 自定义UITextField填写进度动画 卡片缩小至消失 弹出logo动画片尾...</a></p>
  <footer class="post-meta">
    <time datetime="2016-06-18">
      <i class="fa fa-calendar-o"></i> 2016-06-18
    </time>
    <span>
      <i class="fa fa-comments"></i> <a href="/The-Card-Interface-For-Signing-Up/#container">Leave a comment</a>
    </span>
    <span>
    </span>
  </footer>
</article>
<nav class="pagination" role="pagination">
    <a class="older-posts" href="/page/6/" title="Articles old">Last</a>
  <span class="page-number">5 / 6</span>
      <a class="newer-posts" href="/page/4/" title="Articles new">Next</a>
</nav>
    </main>
<footer class="footer">
  <div class="container">
    <ul class="icons">
      <li>
        <a href="https://github.com/desgard" class="icon-github" target="_blank">
          <i class="fa fa-github"></i>
        </a>
      </li>
      <li>
        <a href="https://www.facebook.com/desgard.duan" class="icon-facebook" target="_blank">
          <i class="fa fa-facebook"></i>
        </a>
      </li>
      <li>
        <a href="https://twitter.com/Desgard_Duan" class="icon-twitter" target="_blank">
          <i class="fa fa-twitter"></i>
        </a>
      </li>
      <li>
        <a href="https://stackoverflow.com/users/6119149/desgard-duan" class="icon-github" target="_blank">
          <i class="fa fa-stack-overflow"></i>
        </a>
      </li>
      <li>
        <a href="https://weibo.com/desgard" class="icon-instagram" target="_blank">
          <i class="fa fa-weibo"></i>
        </a>
      </li>
    </ul>
    <p>
      <q>I write many code to write less code.💻</q>
      <small>– Gua</small>
    </p>
    <small class="clearfix">
      Powered by <a href="http://jekyllrb.com" target="_blank">Jekyll</a> • <a href="https://github.com/desgard" target="_blank">Open source <i class="fa fa-heart"></i></a>
    </small>
  </div>
</footer>
<a class="scroll-up fa fa-chevron-up bounce" href="#" data-position="0"></a>
<div id="modalSearch" class="modal">
  <div class="modal__overlay"></div>
  <div class="modal__content">
    <a href="#!" class="modal-close" data-modal-close>&times;</a>
    <div class="search-container">
      <input type="text" id="search-input" placeholder="Search articles">
      <ul id="results-container"></ul>
    </div>
  </div>
</div>
    <script src="/assets/main-52d417e8a6ff9f5b168386d37c96338a.js"></script>
  </body>
  <script>
    var link = "" ;
    var os = function() {  
      var ua = navigator.userAgent,  
      isWindowsPhone = /(?:Windows Phone)/.test(ua),  
      isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,   
      isAndroid = /(?:Android)/.test(ua),   
      isFireFox = /(?:Firefox)/.test(ua),   
      isChrome = /(?:Chrome|CriOS)/.test(ua),  
      isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),  
      isPhone = /(?:iPhone)/.test(ua) && !isTablet,  
      isPc = !isPhone && !isAndroid && !isSymbian;  
      return {  
        isTablet: isTablet,  
        isPhone: isPhone,  
        isAndroid : isAndroid,  
        isPc : isPc  
      };  
    }();  
    if (link.length > 0) {
      if (os.isAndroid || os.isPhone) {
        location.replace(link);
      }
    }
  </script>
</html>